#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
const char *filename="log.txt"; 
int main(){
  int fd=open(filename,O_WRONLY | O_CREAT | O_TRUNC,0666);
//  dup2(fd,1);
    dup2(1,fd);
  printf("hello linux\n");
  fprintf(stdout,"hello,linux\n");
}
